package pl.edu.agh.to;

import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemSelectedListener;

class OrganizerOnItemSelectedListener implements OnItemSelectedListener {
	/**
	 * 
	 */
	private final TemplateActivity templateActivity;

	public TemplateActivity getTemplateActivity() {
		return templateActivity;
	}

	/**
	 * @param templateActivity
	 */
	OrganizerOnItemSelectedListener(TemplateActivity templateActivity) {
		this.templateActivity = templateActivity;
	}

	@Override
	public void onItemSelected(AdapterView<?> parent, View view, int pos,
			long id) {
		getTemplateActivity().onSpinnerItemSelected();
	}

	@Override
	public void onNothingSelected(AdapterView parent) {
		// Do nothing.
	}
}

class RatesOnItemSelectedListener extends OrganizerOnItemSelectedListener {

	RatesOnItemSelectedListener(RatesActivity templateActivity) {
		super(templateActivity);
	}

	@Override
	public void onItemSelected(AdapterView<?> parent, View view, int pos,
			long id) {
		getTemplateActivity().setupSpinner();
	}

}